{% extends 'index.html' %}
{% block body %}
        <table cellpadding="0" cellspacing="3" border="0">
            <tr>
                <th>Numero/Parte</th>
                <th>Operazione</th>
                <th>Data docum.</th>
                <th>Cliente/Fornitore</th>
                 <th>Totale Imponibile</th>
                <th>Totale Imposta</th>
                <th>Totale </th>
                <th>Totale sospeso</th>
                <th>Totale Saldato</th>
                <th>Pagamento</th>
                <th>Banca</th>
            </tr>
            {% for dao in objects %}
            {% set tota = dao.totali %}
            <tr class="row">
                <td class="detail">{{dao.numero|string + ' ' + (dao.parte or '')|string}}</td>

                <td class="detail">{{dao.operazione}}</td>
                <td class="detail">{{utils.dateToString(dao.data_documento)}}</td>
                <td class="detail">{{dao.intestatario}}</td>
                <td class="detail">{{dao._totaleImponibile}}</td>
                <td class="detail">{{dao._totaleImposta}}</td>
                <td class="detail">{{dao._totaleNonScontato}}</td>
                <td class="detail">{{dao.totale_sospeso}}</td>
                <td class="detail">{{dao.totale_pagato}}</td>
                <td class="detail">{{dao.pagamento}}</td>
                <td class="detail">{{dao.banca}}</td>
            </tr>
            {% endfor %}
            <tr>
                <th>TOTALE IMPONIBILE NON SCONTATO</th>
                <th>TOTALE IMPOSTA NON SCONTATA</th>
                <th>TOTALE GENERALE NON SCONTATO </th>
                <th>TOTALE IMPONIBILE SCONTATO</th>
                <th>TOTALE IMPOSTA SCONTATA </th>
                <th>TOTALE GENERALE SCONTATO</th>
                <th>TOTALE SOSPESO</th>
                <th>TOTALE PAGATO</th>
            </tr>
            {% set tot = utils.calcolaTotali(objects) %}
            <tr>
            <td class="detail">{{tot["totale_imponibile_non_scontato"]}}</td>
            <td class="detail">{{tot["totale_imposta_non_scontata"]}}</td>
            <td class="detail">{{tot["totale_non_scontato"]}}</td>
            <td class="detail">{{tot["totale_imponibile_scontato"]}}</td>
            <td class="detail">{{tot["totale_imposta_scontata"]}}</td>
            <td class="detail">{{tot["totale_scontato"]}}</td>
            <td class="detail">{{tot["totale_sospeso"]}}</td>
            <td class="detail">{{tot["totale_pagato"]}}</td>

            </tr>
        </table>
{% endblock %}